home *** CD-ROM | disk | FTP | other *** search
/ CD/PC Actual 76 / DVD Actual 1 Marzo 2003.iso / Trial / TurboCAD 7.1 Pro / Data.Cab / F30292_TCInetTool.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  2000-11-10  |  2.8 KB  |  96 lines

  1. unit TCInetTool;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, oleauto, ActiveX, Graphics, Sysutils, AXCtrls, ComObj, InetTool_TLB, IMSIGX_TLB;
  7.  
  8. type
  9. //  TTCInetTool = class(TTypedComObject, ITCInetTool)
  10.   TTCInetTool = class(TAutoObject, ITCInetTool)
  11.   protected
  12.     function Get_Description: WideString; stdcall;
  13.     function GetToolInfo(var CommandNames, MenuCaptions, StatusPrompts,
  14.       Tooltips, Enabled, WantsUpdate: OleVariant): Integer; stdcall;
  15.     function GetPicture(var LargeImage, MonoImage: WordBool): IPictureDisp;
  16.       stdcall;
  17.     function Initialize(var Tool: IDispatch): WordBool; stdcall;
  18.     function Run(var Tool: IDispatch): WordBool; stdcall;
  19.     function UpdateToolStatus(var Tool: IDispatch; var Enabled,
  20.       Checked: WordBool): WordBool; stdcall;
  21.     {Declare ITCInetTool methods here}
  22.   end;
  23.  
  24. implementation
  25.  
  26. uses ComServ;
  27.  
  28. //'Number of tools in this server
  29. Const NUM_TOOLS = 1;
  30.  
  31. //'Toggle this to test loading buttons from .Bmp/.Res
  32. Const boolLoadFromBmp = False;
  33. Const boolDebug = False;
  34.  
  35. function TTCInetTool.Get_Description: WideString;
  36. begin
  37.     Get_Description := 'Internet connection tool';
  38. end;
  39.  
  40. function TTCInetTool.GetToolInfo(var CommandNames, MenuCaptions,
  41.   StatusPrompts, Tooltips, Enabled, WantsUpdate: OleVariant): Integer;
  42. begin
  43.     VarArrayRedim(CommandNames, NUM_TOOLS);
  44.     VarArrayRedim(MenuCaptions, NUM_TOOLS);
  45.     VarArrayRedim(StatusPrompts, NUM_TOOLS);
  46.     VarArrayRedim(ToolTips, NUM_TOOLS);
  47.     VarArrayRedim(Enabled, NUM_TOOLS);
  48.     VarArrayRedim(WantsUpdate, NUM_TOOLS);
  49.     CommandNames[0]:= 'SDK|Internet|Hyperlink';
  50.     MenuCaptions[0] := '&Hyperlink';
  51.     StatusPrompts[0] := 'Launch a browser on the World Wide Web';
  52.     ToolTips[0] := 'Hyperlink';
  53.     Enabled[0] := True;
  54.     WantsUpdate[0] := False;
  55.  
  56.     GetToolInfo := NUM_TOOLS;
  57.  
  58. end;
  59.  
  60. function TTCInetTool.GetPicture(var LargeImage,
  61.   MonoImage: WordBool): IPictureDisp;
  62. Var pTBmp: TBitMap;
  63.  
  64. begin
  65.  
  66.  
  67. end;
  68.  
  69. function TTCInetTool.Initialize(var Tool: IDispatch): WordBool;
  70. begin
  71.      Initialize := true;
  72. end;
  73.  
  74. function TTCInetTool.Run(var Tool: IDispatch): WordBool;
  75. begin
  76.  
  77. // Add your code here
  78.      MessageBox(0, 'Add your code here', 'TurboCAD SDK tool', IDOK );
  79.      Result := true
  80. end;
  81.  
  82. function TTCInetTool.UpdateToolStatus(var Tool: IDispatch; var Enabled,
  83.   Checked: WordBool): WordBool;
  84.   begin
  85.     Enabled := True;   //'Could do a test here to determine whether to disable the button/menu item
  86.     Checked := False;  // 'Could do a test here to determine whether to check the button/menu item
  87.     UpdateToolStatus := True;
  88. end;
  89.  
  90. initialization
  91. //  TTypedComObjectFactory.Create(ComServer, TTCInetTool, Class_TCInetTool,
  92. //    ciMultiInstance, tmSingle);
  93.   TAutoObjectFactory.Create(ComServer, TTCInetTool, Class_TCInetTool,
  94.     ciMultiInstance, tmSingle);
  95. end.
  96.